package com.song.security.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {

    @RequestMapping("add")
    public String add(){
        return "add";
    }

    @RequestMapping("update")
    public String update(){
        return "update";
    }

    @RequestMapping("get")
    public String get(){
        return "get";
    }

    @PreAuthorize("hasRole('admin')")
    @RequestMapping("delete")
    public String delete(){
        return "delete";
    }
}
